import * as THREE from 'three';
import {repeatWrapping} from '@/utils/repeatWrapping';
import albedo from '@/texture/beach/albedo.png'
import nomals from '@/texture/beach/normal.png'
import aos from '@/texture/beach/ao.png'
import roughnesses from '@/texture/beach/roughness.png'
import heightLights from '@/texture/beach/height.png'

const map = new THREE.TextureLoader().load(albedo);//颜色材质贴图
const nomal = new THREE.TextureLoader().load(nomals);//法线材质贴图
const ao = new THREE.TextureLoader().load(aos);//环境遮挡贴图
const roughness = new THREE.TextureLoader().load(roughnesses);//材质的粗糙度贴图
const light = new THREE.TextureLoader().load(heightLights);//高光贴图

repeatWrapping(map,20,20);//重复平铺颜色贴图
repeatWrapping(nomal,20,20);//重复平铺法线贴图
repeatWrapping(ao,20,20);//重复平铺透明度贴图
repeatWrapping(roughness,20,20);//重复平铺粗糙度贴图
repeatWrapping(light,20,20);//重复平铺高光贴图

//create a blue LineBasicMaterial
const glass = new THREE.MeshStandardMaterial( 
    { 
        color: 0xffffff 
    }
);

glass.map = map
glass.normalMap = nomal
glass.aoMap = ao
glass.roughnessMap = roughness
glass.lightMap = light
glass.emissive = 0x000000
glass.roughness = 1
glass.metalness = 0.1



export default glass